package com.xinjian;

import com.xinjian.base.utils.SpringUtil;
import org.n3r.idworker.Sid;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
// 扫描mybatis mapper包路径
@MapperScan(basePackages = {"com.xinjian.mapper"})
//扫描所有需要的包，包含一些自有的工具类包 所在的路径
@ServletComponentScan(basePackages = {"com.xinjian"})
public class Application {

    @Bean
    public SpringUtil getSpringUtil(){
        return new SpringUtil();
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    /**
     * 注入唯一主键生成器
     * @return
     */
    @Bean
    public Sid returnSid(){
        return new Sid();
    }
}
